<?php namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Message
 *
 * @property integer $id
 * @property string $content
 * @property string $type
 * @property integer $user_id
 * @property integer $to_user_id
 * @property integer $is_read
 * @property integer $to_msg_id
 * @property string $deleted_at
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property-read \App\User $user
 * @property-read \App\User $toUser
 * @method static \Illuminate\Database\Query\Builder|\App\Message whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Message whereContent($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Message whereType($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Message whereUserId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Message whereToUserId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Message whereIsRead($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Message whereToMsgId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Message whereDeletedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Message whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Message whereUpdatedAt($value)
 * @property integer $project_id
 * @method static \Illuminate\Database\Query\Builder|\App\Message whereProjectId($value)
 */
class Message extends Model
{
    protected $table = 'message';
    use SoftDeletes;

    /** 关联用户表 */
    public function user()
    {
        return $this->belongsTo('App\User','user_id');
    }

    /** 隶属于用户表 */
    public function toUser()
    {
        return $this->belongsTo('App\User','to_user_id');
    }
}